<template>
  <div class="e-commerce-product-item">
    <div class="jd-title">
      <h3>{{ productInformation.title }}</h3>
      <p>{{ productInformation.discount }}</p>
    </div>
    <div class="jd-icon">
      <a href="javascript:;">
        <img :src="productInformation.image">
      </a>
      <span v-if="productInformation.detail">{{ productInformation.detail }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'LifeECommerceProductItem',
  props: {
    productInformation: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped>
  .jd-title, .jd-icon {
    width:100%;
    position: relative;
  }
  .jd-title > img {
    width:100%;
  }
  .jd-title span {
    position: absolute;
    top:7px;
    left:0px;
    height:70%;
    display: block;
    width:100%;
    z-index: 2;
    text-align: center;
  }
  .jd-title span img {
    max-height: 100%;
  }
  .jd-title h3 {
    font-size: 16px;
    line-height: 22px;
    font-weight: bold;
  }
  .jd-title p {
    color: #686868;
    font-size: 11px;
    line-height: 15px;
    margin-top: 3px;
  }
  .jd-icon a {
    display: block;
    width:100%;
  }
  .jd-icon a img {
    width:100%;
  }
  .jd-icon span {
    padding:0 2px;
    position: absolute;
    left:-5px;
    bottom: 0;
    font-size:11px;
    color:#fff;
    background: #ff4a7d;
  }
</style>
